package com.wunong.smart.commission.starter.infrastructure.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.wunong.smart.domain.platform.entify.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 代办事项
 *
 * @author create by zealot.zt
 */
@Getter
@Setter
@ToString(callSuper = true)
@Entity
@Table(name = CommissionPO.TABLE_NAME)
@TableName(CommissionPO.TABLE_NAME)
public class CommissionPO extends BaseEntity {

    public static final String TABLE_NAME = "commission";

    /**
     * 用户编号
     */
    @Column(nullable = false)
    private Long userId;

    /**
     * 用户角色
     */
    @Column(nullable = false)
    private Integer userRole;

    /**
     * 业务编号
     */
    @Column(nullable = false, length = 32)
    private String bizId;

    /**
     * 业务类型
     */
    @Column(nullable = false)
    private Integer bizType;

    /**
     * 代办类型
     */
    @Column(nullable = false)
    private String commissionType;

    /**
     * 代办状态
     *
     * @see com.wunong.smart.commission.client.enums.CommissionStatusEnum
     */
    @Column(nullable = false)
    private Integer status;

    /**
     * 结束时间
     */
    private Date finishTime;

    /**
     * 代办内容
     */
    @Column(nullable = false, length = 255)
    private String content;

    public static CommissionPO of() {
        return new CommissionPO();
    }

}
